import json
from fastapi import APIRouter
from xtquant import xtdata

from router import return_json
from utils.stock import get_stock_list

router = APIRouter()

@router.get("/get/codes")
def get_stocks():
    stocks=get_stock_list()
    return return_json(stocks)

@router.get("/get/sectors")
def get_stock_sectors():
    
    return return_json(xtdata.get_sector_list())
   